package com.siwei.mes.mapper;

import com.siwei.mes.common.base.BaseMapper;
import com.siwei.mes.entity.experiment.ExperimentCheckWaybillWeek;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 快检/批检对应按时间生成的配置信息(ExperimentCheckWaybillWeek)表数据库访问层
 *
 * @author linzi
 * @since 2025-03-09 22:58:42
 */
public interface ExperimentCheckWaybillWeekMapper extends BaseMapper<ExperimentCheckWaybillWeek> {
    /**
     * 获取所有
     *
     * @param entity
     * @return
     */
    List<ExperimentCheckWaybillWeek> getList(ExperimentCheckWaybillWeek entity);

    /**
     * 根据id获取
     *
     * @param id
     * @return
     */
    ExperimentCheckWaybillWeek loadById(@Param("id") Long id);

    /**
     * 获取最新的一条
     *
     * @param entity
     * @return
     */
    ExperimentCheckWaybillWeek selectNewInfo(ExperimentCheckWaybillWeek entity);

    /**
     * 根据委托类型和检测类型删除
     *
     * @param experimentType 试验台账类型 1-水泥 2-粉煤灰 3-矿渣粉 4-粗骨料 5-细骨料 6-外加剂
     * @param checkType      1-快检 2-批检
     */
    void deleteByExperimentTypeAndCheckType(@Param("experimentType") Integer experimentType, @Param("checkType") Integer checkType);

    /**
     * 根据试验委托id删除
     *
     * @param experimentId 试验委托id
     */
    void deleteByExperimentId(@Param("experimentId") Long experimentId);
}
